<template>
  <div class="landlord-container">
    <!-- 背景装饰元素 -->
    <div class="background-decoration">
      <!-- 精美的动态背景 -->
      <div class="dynamic-background">
        <div class="building building-1"></div>
        <div class="building building-2"></div>
        <div class="building building-3"></div>
        <div class="building building-4"></div>
        <div class="building building-5"></div>
        <div class="cloud cloud-1"></div>
        <div class="cloud cloud-2"></div>
        <div class="cloud cloud-3"></div>
        <div class="sun"></div>
        <div class="light-ray ray-1"></div>
        <div class="light-ray ray-2"></div>
        <div class="light-ray ray-3"></div>
      </div>

      <!-- 浮动装饰元素 -->
      <div class="floating-shape shape-1"></div>
      <div class="floating-shape shape-2"></div>
      <div class="floating-shape shape-3"></div>
      <div class="floating-shape shape-4"></div>
      <div class="floating-shape shape-5"></div>
      <div class="floating-shape shape-6"></div>
    </div>

    <div class="landlord-wrapper">
      <!-- 顶部导航栏 -->
      <div class="top-navbar">
        <div class="navbar-left">
          <h1 class="app-title">房东中心</h1>
        </div>
        <div class="navbar-center">
          <el-menu
              :default-active="activeIndex"
              mode="horizontal"
              @select="handleSelect"
              background-color="rgba(255, 255, 255, 0.1)"
              text-color="#fff"
              active-text-color="#4A90E2"
          >
            <el-menu-item index="1" @click="goToHome">首页</el-menu-item>
            <el-menu-item index="2" @click="goToSearch">房源搜索</el-menu-item>
            <el-menu-item index="3" @click="goToPublish">发布房源</el-menu-item>
            <el-menu-item index="4" @click="goToMessages">消息中心</el-menu-item>
          </el-menu>
        </div>
        <div class="navbar-right">
          <el-dropdown @command="handleUserCommand">
            <span class="user-info">
              <el-avatar :size="32" src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />
              <span class="username">张三</span>
            </span>
            <template #dropdown>
              <el-dropdown-menu>
                <el-dropdown-item command="profile">个人资料</el-dropdown-item>
                <el-dropdown-item command="settings">设置</el-dropdown-item>
                <el-dropdown-item command="logout" divided>退出登录</el-dropdown-item>
              </el-dropdown-menu>
            </template>
          </el-dropdown>
        </div>
      </div>

      <div class="main-content">
        <!-- 侧边栏 -->
        <div class="sidebar">
          <el-menu
              :default-active="activeMenu"
              class="el-menu-vertical"
              background-color="rgba(0, 0, 0, 0.2)"
              text-color="#fff"
              active-text-color="#4A90E2"
          >
            <el-menu-item index="dashboard" @click="goToHome">
              <el-icon><House /></el-icon>
              <span>首页</span>
            </el-menu-item>
            <el-menu-item index="search" @click="goToSearch">
              <el-icon><Search /></el-icon>
              <span>房源搜索</span>
            </el-menu-item>
            <el-sub-menu index="publish">
              <template #title>
                <el-icon><OfficeBuilding /></el-icon>
                <span>发布房源</span>
              </template>
              <el-menu-item index="publish-house" @click="goToPublishNew">发布新房源</el-menu-item>
              <el-menu-item index="my-houses" @click="goToMyHouses">我的房源</el-menu-item>
            </el-sub-menu>
            <el-sub-menu index="agent">
              <template #title>
                <el-icon><User /></el-icon>
                <span>中介申请</span>
              </template>
              <el-menu-item index="agent-apply" @click="goToAgentApply">申请中介</el-menu-item>
              <el-menu-item index="agent-status" @click="goToAgentStatus">申请状态</el-menu-item>
              <el-menu-item index="agent-houses" @click="goToAgentHouses">可代理房源</el-menu-item>
            </el-sub-menu>
            <el-sub-menu index="rental">
              <template #title>
                <el-icon><Key /></el-icon>
                <span>租房管理</span>
              </template>
              <el-menu-item index="tenant" @click="goToTenant">我是租客</el-menu-item>
              <el-menu-item index="landlord" @click="goToLandlord">我是房东</el-menu-item>
              <el-menu-item index="agent-rental" @click="goToAgentRental">中介租房</el-menu-item>
            </el-sub-menu>
            <el-menu-item index="messages" @click="goToMessages">
              <el-icon><ChatLineSquare /></el-icon>
              <span>消息中心</span>
            </el-menu-item>
            <el-menu-item index="profile" @click="goToProfile">
              <el-icon><Setting /></el-icon>
              <span>个人资料</span>
            </el-menu-item>
          </el-menu>
        </div>

        <!-- 房东内容区 -->
        <div class="content-area">
          <div class="landlord-header">
            <h2>房东中心</h2>
            <p>管理您的房源和租赁信息</p>
          </div>

          <!-- 统计卡片 -->
          <div class="landlord-stats">
            <el-row :gutter="20">
              <el-col :span="6">
                <div class="stat-card">
                  <div class="stat-icon bg-blue">
                    <House />
                  </div>
                  <div class="stat-content">
                    <div class="stat-value">{{ totalHouses }}</div>
                    <div class="stat-title">房源总数</div>
                  </div>
                </div>
              </el-col>
              <el-col :span="6">
                <div class="stat-card" @click="goToCheckoutApplications">
                  <div class="stat-icon bg-green">
                    <User />
                  </div>
                  <div class="stat-content">
                    <div class="stat-value">{{ checkoutApplicationsCount }}</div>
                    <div class="stat-title">退租申请</div>
                  </div>
                </div>
              </el-col>
              <el-col :span="6">
                <div class="stat-card" @click="goToContractApplications">
                  <div class="stat-icon bg-orange">
                    <Document />
                  </div>
                  <div class="stat-content">
                    <div class="stat-value">{{ contractApplications }}</div>
                    <div class="stat-title">签约申请</div>
                  </div>
                </div>
              </el-col>
              <el-col :span="6">
                <div class="stat-card" @click="goToMaintenanceApplications">
                  <div class="stat-icon bg-red">
                    <Money />
                  </div>
                  <div class="stat-content">
                    <div class="stat-value">{{ maintenanceApplicationsCount }}</div>
                    <div class="stat-title">维修申请</div>
                  </div>
                </div>
              </el-col>
            </el-row>
          </div>

          <!-- 房源管理 -->
          <div class="houses-section">
            <el-tabs v-model="activeTab" @tab-change="handleTabChange">
              <el-tab-pane label="所有房源" name="all">
                <div class="houses-list">
                  <el-row :gutter="20">
                    <el-col
                        :span="12"
                        v-for="house in allHouses"
                        :key="house.id"
                        class="house-col"
                    >
                      <div class="house-card">
                        <div class="house-image">
                          <img :src="house.image" :alt="house.title" />
                          <div class="house-price">¥{{ house.price }}/月</div>
                          <div class="house-status" :class="house.status">
                            {{ getHouseStatusText(house.status) }}
                          </div>
                        </div>
                        <div class="house-info">
                          <h3 class="house-title">{{ house.title }}</h3>
                          <p class="house-address">
                            <el-icon><Location /></el-icon>
                            {{ house.address }}
                          </p>
                          <div class="house-meta">
                            <span>{{ house.layout }}</span>
                            <span>{{ house.area }}㎡</span>
                            <span>{{ house.orientation }}</span>
                          </div>
                          <div class="house-rental-info" v-if="house.tenant">
                            <p><el-icon><User /></el-icon> 租客: {{ house.tenant.name }}</p>
                            <p><el-icon><Calendar /></el-icon> 租期: {{ house.tenant.rentalPeriod }}</p>
                          </div>
                          <div class="house-actions">
                            <el-button
                                size="small"
                                type="primary"
                                @click="publishHouse(house)"
                            >
                              发布房源
                            </el-button>
                            <el-button
                                size="small"
                                @click="editHouse(house)"
                            >
                              编辑信息
                            </el-button>
                          </div>
                        </div>
                      </div>
                    </el-col>
                  </el-row>
                </div>
              </el-tab-pane>
              <el-tab-pane label="待出租" name="vacant">
                <div class="houses-list">
                  <el-row :gutter="20">
                    <el-col
                        :span="12"
                        v-for="house in vacantHouses"
                        :key="house.id"
                        class="house-col"
                    >
                      <div class="house-card">
                        <div class="house-image">
                          <img :src="house.image" :alt="house.title" />
                          <div class="house-price">¥{{ house.price }}/月</div>
                          <div class="house-status" :class="house.status">
                            {{ getHouseStatusText(house.status) }}
                          </div>
                        </div>
                        <div class="house-info">
                          <h3 class="house-title">{{ house.title }}</h3>
                          <p class="house-address">
                            <el-icon><Location /></el-icon>
                            {{ house.address }}
                          </p>
                          <div class="house-meta">
                            <span>{{ house.layout }}</span>
                            <span>{{ house.area }}㎡</span>
                            <span>{{ house.orientation }}</span>
                          </div>
                          <div class="house-actions">
                            <el-button
                                size="small"
                                type="primary"
                                @click="publishHouse(house)"
                            >
                              发布房源
                            </el-button>
                            <el-button
                                size="small"
                                @click="editHouse(house)"
                            >
                              编辑信息
                            </el-button>
                          </div>
                        </div>
                      </div>
                    </el-col>
                  </el-row>
                </div>
              </el-tab-pane>
              <el-tab-pane label="租赁中" name="rented">
                <div class="houses-list">
                  <el-table :data="rentedHouses" style="width: 100%">
                    <el-table-column prop="title" label="房源标题" width="200"></el-table-column>
                    <el-table-column prop="address" label="地址" width="250"></el-table-column>
                    <el-table-column prop="tenant.name" label="租客" width="120"></el-table-column>
                    <el-table-column prop="tenant.rentalPeriod" label="租期" width="200"></el-table-column>
                    <el-table-column prop="price" label="月租金" width="120">
                      <template #default="scope">
                        ¥{{ scope.row.price }}
                      </template>
                    </el-table-column>
                    <el-table-column prop="status" label="状态" width="120">
                      <template #default="scope">
                        <el-tag :type="getHouseStatusType(scope.row.status)">
                          {{ getHouseStatusText(scope.row.status) }}
                        </el-tag>
                      </template>
                    </el-table-column>
                    <el-table-column label="操作" width="200">
                      <template #default="scope">
                        <el-button size="small" @click="viewContracts(scope.row)">合同</el-button>
                        <el-button size="small" @click="contactTenant(scope.row)">联系</el-button>
                        <el-button size="small" @click="collectRent(scope.row)">收租</el-button>
                      </template>
                    </el-table-column>
                  </el-table>
                </div>
              </el-tab-pane>
            </el-tabs>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import {
  House,
  Search,
  OfficeBuilding,
  User,
  Key,
  ChatLineSquare,
  Setting,
  Location,
  Calendar,
  Money,
  Document,
  Plus
} from '@element-plus/icons-vue'

const router = useRouter()
const activeMenu = ref('landlord')
const activeIndex = ref('1')
const activeTab = ref('all')

// 统计数据
const totalHouses = ref(8)
const totalTenants = ref(5)
const contractApplications = ref(2)
const monthlyIncome = ref(13000)

// 所有房源
const allHouses = ref([
  {
    id: 1,
    title: '精致一居室公寓',
    address: '北京市朝阳区CBD建国路123号',
    price: 4500,
    area: 60,
    layout: '1室1厅',
    orientation: '南北',
    image: 'https://images.unsplash.com/photo-1560448204-e02f11c3d0e2?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1769&q=80',
    status: 'published',
    tenant: {
      name: '张三',
      rentalPeriod: '2023-01-01 至 2023-12-31'
    }
  },
  {
    id: 2,
    title: '豪华两居室',
    address: '北京市朝阳区三里屯太古里456号',
    price: 8500,
    area: 90,
    layout: '2室1厅',
    orientation: '南',
    image: 'https://images.unsplash.com/photo-1600585154340-be6161a56a0c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80',
    status: 'vacant'
  }
])

// 待出租房源
const vacantHouses = ref([
  {
    id: 2,
    title: '豪华两居室',
    address: '北京市朝阳区三里屯太古里456号',
    price: 8500,
    area: 90,
    layout: '2室1厅',
    orientation: '南',
    image: 'https://images.unsplash.com/photo-1600585154340-be6161a56a0c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80',
    status: 'vacant'
  },
  {
    id: 3,
    title: '舒适三居室',
    address: '北京市朝阳区国贸SOHO789号',
    price: 12000,
    area: 120,
    layout: '3室2厅',
    orientation: '南北',
    image: 'https://images.unsplash.com/photo-1600596542815-ffad4c1539a9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80',
    status: 'vacant'
  }
])

// 租赁中房源
const rentedHouses = ref([
  {
    id: 1,
    title: '精致一居室公寓',
    address: '北京市朝阳区CBD建国路123号',
    price: 4500,
    area: 60,
    layout: '1室1厅',
    orientation: '南北',
    status: 'rented',
    tenant: {
      name: '张三',
      rentalPeriod: '2023-01-01 至 2023-12-31'
    }
  },
  {
    id: 4,
    title: '现代化loft公寓',
    address: '北京市朝阳区798艺术区303号',
    price: 6500,
    area: 75,
    layout: '1室1厅',
    orientation: '东',
    status: 'rented',
    tenant: {
      name: '李四',
      rentalPeriod: '2023-03-01 至 2024-02-29'
    }
  }
])

// 获取房源状态类型
const getHouseStatusType = (status) => {
  const statusTypes = {
    'published': 'success',
    'vacant': 'warning',
    'rented': 'info'
  }
  return statusTypes[status] || 'info'
}

// 获取房源状态文本
const getHouseStatusText = (status) => {
  const statusTexts = {
    'published': '已发布',
    'vacant': '待出租',
    'rented': '租赁中'
  }
  return statusTexts[status] || '未知状态'
}

// 顶部导航栏跳转
const goToHome = () => {
  router.push('/')
}

const goToSearch = () => {
  router.push('/house/search')
}

const goToPublish = () => {
  router.push('/house/publish')
}

const goToMessages = () => {
  router.push('/message')
}

// 用户命令处理
const handleUserCommand = (command) => {
  switch (command) {
    case 'profile':
      router.push('/profile')
      break
    case 'settings':
      router.push('/settings')
      break
    case 'logout':
      ElMessage.success('退出登录成功')
      localStorage.removeItem('userEmail')
      localStorage.removeItem('isLoggedIn')
      router.push('/login')
      break
  }
}

// 侧边栏跳转
const goToPublishNew = () => {
  router.push('/house/publish')
}

const goToMyHouses = () => {
  router.push('/house/my-houses')
}

const goToAgentApply = () => {
  router.push('/agent/apply')
}

const goToAgentStatus = () => {
  router.push('/agent/status')
}

const goToAgentHouses = () => {
  router.push('/agent/houses')
}

const goToTenant = () => {
  router.push('/rental/tenant')
}

const goToLandlord = () => {
  router.push('/rental/landlord')
}

const goToAgentRental = () => {
  router.push('/rental/agent')
}

const goToProfile = () => {
  router.push('/profile')
}

// 菜单选择处理
const handleSelect = (key) => {
  switch (key) {
    case '1':
      router.push('/')
      break
    case '2':
      router.push('/house/search')
      break
    case '3':
      router.push('/house/publish')
      break
    case '4':
      router.push('/message')
      break
  }
}

// 查看合同申请
const goToContractApplications = () => {
  router.push('/contract/landlord')
}

// 处理标签切换
const handleTabChange = (tab) => {
  ElMessage.info(`切换到${tab === 'all' ? '所有房源' : tab === 'vacant' ? '待出租' : '租赁中'}标签`)
}

// 管理房源
const manageHouse = (house) => {
  ElMessage.info(`管理"${house.title}"`)
}

// 查看合同
const viewContracts = (house) => {
  ElMessage.info(`查看"${house.title}"的合同`)
}

// 联系租客
const contactTenant = (house) => {
  ElMessage.info(`联系"${house.title}"的租客`)
}

// 发布房源
const publishHouse = (house) => {
  ElMessage.info(`发布"${house.title}"`)
}

// 编辑房源
const editHouse = (house) => {
  ElMessage.info(`编辑"${house.title}"`)
}

// 收租
const collectRent = (house) => {
  ElMessage.info(`收取"${house.title}"的租金`)
}

// 查看所有合同
const viewContractsAll = () => {
  ElMessage.info('查看所有合同')
}

// 查看消息
const viewMessages = () => {
  router.push('/message')
}

// 查看财务
const viewFinancial = () => {
  ElMessage.info('查看财务信息')
}
// 查看退租申请
const goToCheckoutApplications = () => {
  router.push('/rental/landlord/checkout-opt')
}

// 查看维修申请
const goToMaintenanceApplications = () => {
  router.push('/rental/landlord/maintenance')
}
</script>

<style scoped>
.landlord-container {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
}

.background-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

/* 精美的动态背景 */
.dynamic-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, #1a2980, #26d0ce);
  overflow: hidden;
}

/* 建筑物 */
.building {
  position: absolute;
  bottom: 0;
  background: rgba(30, 30, 50, 0.8);
  border-radius: 5px 5px 0 0;
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
}

.building-1 {
  left: 10%;
  width: 80px;
  height: 300px;
  animation: buildingGlow 4s infinite alternate;
}

.building-2 {
  left: 25%;
  width: 120px;
  height: 400px;
  animation: buildingGlow 5s infinite alternate-reverse;
}

.building-3 {
  left: 45%;
  width: 100px;
  height: 350px;
  animation: buildingGlow 6s infinite alternate;
}

.building-4 {
  left: 65%;
  width: 140px;
  height: 450px;
  animation: buildingGlow 4.5s infinite alternate-reverse;
}

.building-5 {
  left: 80%;
  width: 90px;
  height: 320px;
  animation: buildingGlow 5.5s infinite alternate;
}

@keyframes buildingGlow {
  0% {
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
  }
  100% {
    box-shadow: 0 -5px 25px rgba(100, 200, 255, 0.6);
  }
}

/* 云朵 */
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  filter: blur(2px);
}

.cloud-1 {
  top: 20%;
  left: 5%;
  width: 80px;
  height: 30px;
  animation: cloudMove 25s linear infinite;
}

.cloud-2 {
  top: 35%;
  left: 70%;
  width: 120px;
  height: 40px;
  animation: cloudMove 30s linear infinite;
}

.cloud-3 {
  top: 15%;
  left: 40%;
  width: 100px;
  height: 35px;
  animation: cloudMove 35s linear infinite;
}

@keyframes cloudMove {
  0% {
    transform: translateX(-100px);
  }
  100% {
    transform: translateX(calc(100vw + 100px));
  }
}

/* 太阳 */
.sun {
  position: absolute;
  top: 80px;
  right: 100px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, #ffeb3b, #ffc107);
  border-radius: 50%;
  box-shadow: 0 0 40px #ff9800, 0 0 80px #ff5722;
  animation: sunPulse 3s infinite alternate;
}

@keyframes sunPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 40px #ff9800, 0 0 80px #ff5722;
  }
  100% {
    transform: scale(1.1);
    box-shadow: 0 0 60px #ff9800, 0 0 100px #ff5722;
  }
}

/* 光线 */
.light-ray {
  position: absolute;
  top: 120px;
  right: 140px;
  width: 400px;
  height: 200px;
  background: linear-gradient(to right, transparent, rgba(255, 235, 59, 0.2), transparent);
  transform-origin: left center;
  animation: rayRotate 10s infinite linear;
}

.ray-1 {
  transform: rotate(0deg);
  animation-delay: 0s;
}

.ray-2 {
  transform: rotate(60deg);
  animation-delay: 2s;
}

.ray-3 {
  transform: rotate(120deg);
  animation-delay: 4s;
}

@keyframes rayRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 浮动装饰元素 */
.floating-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 15s infinite linear;
}

.shape-1 {
  width: 300px;
  height: 300px;
  top: -100px;
  left: -100px;
  animation-duration: 20s;
  background: radial-gradient(circle, rgba(74, 144, 226, 0.2) 0%, transparent 70%);
}

.shape-2 {
  width: 200px;
  height: 200px;
  bottom: -80px;
  right: -80px;
  animation-duration: 25s;
  animation-direction: reverse;
  background: radial-gradient(circle, rgba(255, 107, 107, 0.2) 0%, transparent 70%);
}

.shape-3 {
  width: 150px;
  height: 150px;
  top: 30%;
  right: 20%;
  animation-duration: 15s;
  background: radial-gradient(circle, rgba(80, 227, 194, 0.2) 0%, transparent 70%);
}

.shape-4 {
  width: 100px;
  height: 100px;
  bottom: 20%;
  left: 20%;
  animation-duration: 18s;
  animation-direction: reverse;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.2) 0%, transparent 70%);
}

.shape-5 {
  width: 250px;
  height: 250px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 22s;
  background: radial-gradient(circle, rgba(155, 89, 182, 0.2) 0%, transparent 70%);
}

.shape-6 {
  width: 180px;
  height: 180px;
  top: 70%;
  left: 10%;
  animation-duration: 28s;
  background: radial-gradient(circle, rgba(231, 76, 60, 0.2) 0%, transparent 70%);
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(20px, 20px) rotate(90deg);
  }
  50% {
    transform: translate(0, 40px) rotate(180deg);
  }
  75% {
    transform: translate(-20px, 20px) rotate(270deg);
  }
  100% {
    transform: translate(0, 0) rotate(360deg);
  }
}

.landlord-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  z-index: 1;
  position: relative;
}

.top-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.app-title {
  color: white;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.navbar-center {
  flex: 1;
  margin: 0 20px;
}

:deep(.el-menu--horizontal) {
  border: none;
  background: transparent !important;
}

:deep(.el-menu--horizontal .el-menu-item) {
  color: white;
  border: none;
}

:deep(.el-menu--horizontal .el-menu-item:hover) {
  background: rgba(255, 255, 255, 0.2) !important;
}

:deep(.el-menu--horizontal .el-menu-item.is-active) {
  color: #4A90E2 !important;
  border: none;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: white;
}

.username {
  font-size: 16px;
  font-weight: 500;
}

.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 20px 0;
  height: 100%;
  box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
}

.el-menu-vertical {
  border: none !important;
  height: 100%;
}

.el-menu-item,
.el-sub-menu__title {
  margin: 5px 10px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.el-menu-item:hover,
.el-sub-menu__title:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 20px;
}

.landlord-header {
  margin-bottom: 30px;
}

.landlord-header h2 {
  color: #2c3e50;
  font-size: 28px;
  margin: 0 0 10px;
}

.landlord-header p {
  color: #7f8c8d;
  margin: 0;
}

.landlord-stats {
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 100px;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  color: white;
  font-size: 24px;
}

.bg-blue {
  background: linear-gradient(135deg, #4A90E2 0%, #64b5f6 100%);
}

.bg-green {
  background: linear-gradient(135deg, #50E3C2 0%, #80deea 100%);
}

.bg-orange {
  background: linear-gradient(135deg, #FFA500 0%, #ffb74d 100%);
}

.bg-red {
  background: linear-gradient(135deg, #FF6B6B 0%, #ff8a80 100%);
}

.bg-purple {
  background: linear-gradient(135deg, #9B59B6 0%, #ba68c8 100%);
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 5px;
}

.stat-title {
  font-size: 14px;
  color: #7f8c8d;
}

.houses-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.houses-list {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.house-col {
  margin-bottom: 20px;
}

.house-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 100%;
}

.house-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.house-image {
  position: relative;
  height: 200px;
}

.house-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.house-card:hover .house-image img {
  transform: scale(1.05);
}

.house-price {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(74, 144, 226, 0.9);
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
}

.house-status {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: #7f8c8d;
  padding: 5px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12px;
}

.house-status.published {
  color: #67C23A;
}

.house-status.vacant {
  color: #E6A23C;
}

.house-status.rented {
  color: #409EFF;
}

.house-info {
  padding: 15px;
}

.house-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
}

.house-address {
  margin: 0 0 10px;
  font-size: 14px;
  color: #7f8c8d;
  display: flex;
  align-items: center;
  gap: 5px;
}

.house-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  color: #7f8c8d;
}

.house-rental-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 15px;
}

.house-rental-info p {
  margin: 0 0 5px;
  font-size: 14px;
  color: #7f8c8d;
  display: flex;
  align-items: center;
  gap: 5px;
}

.house-rental-info p:last-child {
  margin-bottom: 0;
}

.house-actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 992px) {
  .sidebar {
    width: 80px;
  }

  .app-title,
  .el-menu-item span,
  .el-sub-menu__title span {
    display: none;
  }

  .landlord-header {
    text-align: center;
  }

  .landlord-stats .el-row {
    flex-direction: column;
    gap: 15px;
  }

  .landlord-stats .el-col {
    width: 100%;
  }
}
</style>

